{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "b0c7a621",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.linear_model import LinearRegression, LogisticRegression  \n",
    "from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor \n",
    "from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor, GradientBoostingClassifier, GradientBoostingRegressor \n",
    "from sklearn.svm import SVC, SVR \n",
    "from sklearn.naive_bayes import GaussianNB \n",
    "from sklearn.neighbors import KNeighborsClassifier, KNeighborsRegressor \n",
    "from sklearn.cluster import KMeans  \n",
    "from sklearn.model_selection import train_test_split \n",
    "from sklearn import datasets\n",
    "from sklearn.preprocessing import StandardScaler"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "5ea1fdde",
   "metadata": {},
   "outputs": [],
   "source": [
    "iris = datasets.load_iris() \n",
    "\n",
    "X = iris.data \n",
    "y = iris.target \n",
    "target_names = iris.target_names  \n",
    "\n",
    "# стандартизируем входные данные \n",
    "std_scaler = StandardScaler() \n",
    "# X = std_scaler.fit_transform(X, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "ed629179",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.8924486678535343"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_train, X_test, y_train, y_test = train_test_split(X[:, 0:2], X[:, 2], \n",
    "                                                    shuffle=True, train_size=0.8, random_state=42)  \n",
    "linear_regressor = LinearRegression().fit(X_train, y_train) \n",
    "linear_regressor.score(X_test, y_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d72771b9",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.16"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
